<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>字符串大小写转换</title>
</head>

<body>
    <script type="text/javascript">
        function toUpperCase(str) {
            return str.toUpperCase()
        }

        function toLowerCase(str) {
            return str.toLowerCase()
        }
        var str = prompt("请输入一串字符");
        document.write('原字符串为：' + str + '<br/>');
        document.write(toUpperCase(str) + '<br/>');
        document.write(toLowerCase(str));
    </script>
</body>

</html>